﻿package com.ufenlei.LTS{

	import flash.display.Shape;
	import flash.text.TextField;
	import flash.text.TextFormat;
	import com.ufenlei.tool.RoundRectangle;

	public class RoundRectHead extends Head {
		private var roundRectHeadWidth:int;
		private var roundRectHeadHeight:int;
		private var ellipseWidth:int;
		private var ellipseHeight:int;
		private var headText:TextField;
		private var textFormat:TextFormat = new TextFormat();
		private var roundRect:RoundRectangle;

		public function RoundRectHead(RRW:int = 0,RRH:int = 0,EW:int = 0,EH:int = 0,HT:String = null) {
			roundRectHeadWidth=RRW;
			roundRectHeadHeight=RRH;
			ellipseWidth=EW;
			ellipseHeight=EH;
			textFormat.color=0XD555555;
			textFormat.bold=true;
			textFormat.size=12;
			headText = new TextField();
			headText.text=HT;
			headText.height=RRH;
			headText.width=RRW/2;
			headText.x=10;
			headText.y=2;
			headText.selectable=false;
			headText.setTextFormat(textFormat);
			roundRect = new RoundRectangle(roundRectHeadWidth,roundRectHeadHeight,0xffffff,0xaaaaaa,1,5,5);
			this.addChild(roundRect);
			addChild(headText);
		}
		public function get headWidth():int{
			return (roundRect.width);
		}
		public function get headHeight():int{
			return (roundRect.height);
		}
		public function setTitle(ht:String):void{
			headText.text = ht;
			headText.setTextFormat(textFormat);
		}
		public function ChangeWidth(wid:int):void {
			this.width=wid;
		}
		public function ChangeHeight(hei:int):void {
			this.height=hei;
		}
	}
}